<?php
/**
 * @version		$Id: view.html.php 108 2011-02-26 16:40:33Z happy_noodle_boy $
 * @package		JCE
 * @copyright	Copyright (C) 2009 Ryan Demmer. All rights reserved.
 * @copyright	Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
 * @license		GNU/GPL
 * This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');


/**
 * Extension Manager Default View
 *
 * @package		JCE
 * @since		1.5
 */
class WFViewPreferences extends JView
{
    function display($tpl = null)
    {
        $db = &JFactory::getDBO();

        $client = JRequest::getWord('client', 'admin');
        
        require_once(JPATH_COMPONENT . DS . 'helpers' . DS . 'component.php');
        
        $this->document->setTitle(WFText::_('WF_PREFERENCES_TITLE'));		
		$this->document->addStyleSheet('templates/system/css/system.css');
 
 		$component 	= WFComponentHelper::getComponent();
        $xml 		= JPATH_COMPONENT.DS.'models'.DS.'preferences.xml';
        
        // get params definitions
        $params = new WFParameter($component->params, $xml, 'preferences');
        $params->addElementPath(JPATH_COMPONENT.DS.'elements');
        
        $this->assignRef('params', $params);
        
        if (JRequest::getInt('saved') == 1) {
        	$this->document->addScriptDeclaration('window.setTimeout(function(){window.parent.document.location.href="index.php?option=com_jce&view=cpanel"}, 100);');
        }
        
        parent::display($tpl);
    }
}